<?php
namespace app\admin\controller;

use think\Db;
use think\Request;

class Sys extends Admin
{
    /*
     * seo配置
     * */
    public function SysConf()
    {
        $row=model('Common/Sys')->getConf();
        $this->assign('row',$row);
        return $this->fetch('sys_conf');
    }
    /*
     * 设置邮件
     * */
    public function EmailConf(){
        $row=model('Common/Sys')->getConf();
        $this->assign('row',$row);
        return $this->fetch('email_conf');
    }
    /*
     * 保存配置表
     * */
    public function SaveConf(){
        if(Request::instance()->isPost()){
            $data=input("post.");
            $data['email_open']=isset($data['email_open'])?$data['email_open']:0;
            $flag=model('Sys')->dataSave($data);
            if($flag){
                $this->success('操作成功');
            }else{
                $this->error('操作失败');
            }
        }else{
            $this->error('操作有误');
        }
    }
}
